//Copyright 2010 Balazs Keri, Imre Keri
//
//This file is part of FireworksCreator.
//
//FireworksCreator is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//FireworksCreator is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with FireworksCreator.  If not, see <http://www.gnu.org/licenses/>.
//
#ifndef _ATTREVENT_H
#define	_ATTREVENT_H
#include "viewattribute.h"
class View;
//
class AttrEvent {
   //type
public:
   enum Type {
      value_changed
   }; 
   //structors
public:
   inline AttrEvent(Type type, View *origin);
   virtual ~AttrEvent();
   //get methods
public:
   inline Type get_type() const;
   inline View *get_origin() const;
   //data
public:
   const Type type;
private:
   View *origin;
};
//
class AttrValueChanged : public AttrEvent {
   //structors
public:
   inline AttrValueChanged(const ViewAttribute *attr, View *origin);
   //get methods
   inline ViewAttributeName get_name() const;
   inline const ViewAttribute *get_attribute() const;
   //data
private:
   const ViewAttribute *attribute;
};
//
//inline functions
inline AttrEvent::AttrEvent(Type _type, View* _origin)
:
type(_type), origin(_origin) {
}
inline AttrEvent::Type AttrEvent::get_type() const {
   return type;
}
inline View *AttrEvent::get_origin() const {
   return origin;
}
//
inline AttrValueChanged::AttrValueChanged(const ViewAttribute *attr, View* origin)
:
AttrEvent(value_changed, origin), attribute(attr) {
}
inline ViewAttributeName AttrValueChanged::get_name() const {
   return attribute->get_name();
}
inline const ViewAttribute *AttrValueChanged::get_attribute() const {
   return attribute;
}
#endif	/* _ATTREVENT_H */
